<template>
  <div id="app">
    <router-view></router-view>
    <loading v-model="isLoading" :text="loadingText"></loading>
  </div>
</template>

<script>
  import Vue from 'vue'
  import {Loading, ToastPlugin, AjaxPlugin} from 'vux'
  import {mapState} from 'vuex'

  Vue.use(ToastPlugin) // toast
  Vue.use(AjaxPlugin) // axios http请求

  export default {
    name: 'app',
    components: {
      Loading
    },
    computed: {
      ...mapState({
        isLoading: state => state.common.isLoading,
        loadingText: state => state.common.loadingText
      })
    }
  }
</script>

<style lang="less">
  @import '~vux/src/styles/reset.less';
  @import '~vux/src/styles/1px.less';
  @import '~vux/src/styles/close.less';
</style>
